package com.example.kemgdemo.model;

import com.example.kemgdemo.model.enumentity.KengStatus;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.Date;

/**
 * 学号：1401030048
 * Created by 梁嘉伟 on 2019/7/11
 */
// todo keng -> toilet -> building
@Getter
@Setter
@Entity(name = "keng")
@Table(name = "keng")
@Where(clause = "is_deleted = false")
@DynamicUpdate
public class KengEntity extends BaseEntity {

    @Column(name = "status")
    private KengStatus status;

    @Column(name = "time")
    private Date time;

    @Column(name = "isActive")
    private Integer isActive;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "toilet_id")
    private ToiletEntity toiletEntity;
}
